<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>toRef和context参数</title>
    <script src="../vue.global.js"></script>
</head>
<body>
<div id="app"></div>
<script>
    const app = Vue.createApp({
        data() {
            return {

            }
        },
        methods: {},
        template: `
          <div>{{name}}</div>
        `,
        setup(props,context){
            const {reactive,toRef} = Vue;
            const data = reactive({name:'dell'})
            const name = toRef(data,'name')
            setTimeout(()=>{
                name.value = 'lee'
            },2000)
            return { name }
        }
    });
    const vm = app.mount("#app");
</script>
</body>
</html>